/***********************************************************************
 * Module:  VehicleClassificationController.java
 * Author:  Administrator
 * Purpose: Defines the Class VehicleClassificationController
 ***********************************************************************/

package ishitong.vehicleManagement.controller;

import ishitong.common.model.SysCode;
import ishitong.dataDictionary.controller.SysCodeType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/** @pdOid 872f9ece-2f67-431c-b863-8a30b731f346 */
@Controller
public class VehicleClassificationController extends ishitong.common.controller.ActionController {
   /** @pdOid e627c2ad-1222-4a4f-9e4a-089ca8eeb37d */
   private static final String VCC_SLT_DLG = "vehicleManagement/vehicleClassification/vehicleClassificationSelectDialog";
   /** @pdOid ac473528-4fb6-480d-8843-0d47571817ce */
   private static final String VCC_SLT_LST = "vehicleManagement/vehicleClassification/vehicleClassificationSelectList";
   
   /** @param request
    * @pdOid 4f328a73-e7ce-4f61-a0f0-89b9778d55c5 */
   @RequestMapping(value = "/ajaxShowVehicleClassificationSelectDialog.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxShowVehicleClassificationSelectDialog(HttpServletRequest request) {
   	return new ModelAndView(VCC_SLT_DLG);
   }
   
   /** @param request 
    * @param sysCode
    * @pdOid ebafbde7-b0b7-4b21-a74d-05db2ae2d8f9 */
   @RequestMapping(value = "/ajaxFindVehicleClassificationSelectList.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxFindVehicleClassificationSelectList(HttpServletRequest request, SysCode sysCode) {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		List<SysCode> listVehicleClassification = spiSysCodeService.getSysCodeListByTypeCodeAndCondition(SysCodeType.VEHICLE_SORT,sysCode);
   		model.put("listVehicleClassification", listVehicleClassification);
   		return new ModelAndView(VCC_SLT_LST, model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }

}